﻿using System.ComponentModel;
using Util;

namespace IterationLife.FootballTeaching.Enums
{
    /// <summary>
    /// 难度系数类型
    /// </summary>
    public enum DifficultyType
    {
        /// <summary>
        /// 一级
        /// </summary>
        [Description("一级")]
        OneLevel = 1,
        /// <summary>
        /// 二级
        /// </summary>
        [Description("二级")]
        TwoLevel = 2,
        /// <summary>
        /// 三级
        /// </summary>
        [Description("三级")]
        ThreeLevel = 3,
        /// <summary>
        /// 四级
        /// </summary>
        [Description("四级")]
        FourLevel = 4,
        /// <summary>
        /// 五级
        /// </summary>
        [Description("五级")]
        FiveLevel = 5
    }

    /// <summary>
    /// 难度系数类型枚举扩展
    /// </summary>
    public static class DifficultyTypeExtensions
    {
        /// <summary>
        /// 获取描述
        /// </summary>
        public static string Description(this DifficultyType? type)
        {
            return type == null ? string.Empty : type.Value.Description();
        }

        /// <summary>
        /// 获取值
        /// </summary>
        public static int? Value(this DifficultyType? type)
        {
            return type?.Value();
        }
    }
}
